package com.leetcode.partition14;

/**
 * @author rkc
 * @date 2022/8/26 9:29
 */
public class LC1344时钟指针的夹角 {

    public double angleClock(int hour, int minutes) {
        if (hour == 12) hour = 0;
        int a = 360 / 12, b = a / 5;
        double h = hour * a + minutes / 60.0 * a, m = minutes * b;
        double ans = Math.abs(m - h);
        if (ans > 180) ans = 360 - ans;
        return ans;
    }
}
